package com.jin.webvideo.videoCache.policy;

import com.jin.webvideo.parser.ParseResult;
import com.jin.webvideo.util.base.MapUtil;
import com.jin.webvideo.videoCache.policy.condition.Condition;

import java.util.Map;

public class CacheCondition implements Condition<ParseResult> {
    private Condition<Map<String,String>> condition;
    public CacheCondition(Condition<Map<String,String>> condition){
        this.condition = condition;
    }
    @Override
    public boolean compute(ParseResult parseResult) {
        return condition.compute(MapUtil.toMap(parseResult, false));
    }
}
